﻿<UserControl x:Class="TVManager.WatchedSeasonsControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Grid>
        <ScrollViewer VerticalScrollBarVisibility="Auto">
            <ItemsControl x:Name="seasonListBox" Width="Auto" Height="Auto">
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="{Binding Series.SeriesName}" />
                                <TextBlock Text=" Season " />
                                <TextBlock Text="{Binding SeasonNumber}" />
                            </StackPanel>

                            <ItemsControl Grid.Row="1" Margin="5" ItemsSource="{Binding Episodes}">
                                <ItemsControl.ItemTemplate>
                                    <DataTemplate>
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Tag="{Binding}" Width="Auto" Text="{Binding EpisodeNameAndNumber}" TextDecorations="Underline" Foreground="Blue" Cursor="Hand" MouseLeftButtonUp="TextBlock_MouseLeftButtonUp" />
                                            <TextBlock Text=" " />
                                            <TextBlock Text="{Binding Path=FirstAired, StringFormat=\{0:d\}}" />
                                        </StackPanel>
                                    </DataTemplate>
                                </ItemsControl.ItemTemplate>
                            </ItemsControl>
                        </Grid>
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>
        </ScrollViewer>
    </Grid>
</UserControl>
